vim.g.mapleader        = ' '
vim.bo.filetype        = 'off'
vim.opt.autoindent     = true
vim.opt.termguicolors  = true
vim.opt.number         = true
vim.opt.relativenumber = true
vim.opt.mouse          = 'n'
vim.opt.mousemoveevent = true
vim.opt.hlsearch       = true
vim.opt.tabstop        = 4
vim.opt.softtabstop    = 4
vim.opt.expandtab      = true
vim.opt.textwidth      = 160
vim.opt.shiftwidth     = 4
-- vim.o.clipboard sets the type of clipboard to be used for yanking and pasting.
-- The value "unnamedplus" means that the system clipboard will be used.
-- When you yank or copy something in Neovim, it will be automatically saved to the system clipboard and can be pasted in other programs as well.
-- Similarly, if you copy something from outside of Neovim, it can be pasted into Neovim using the system clipboard.
vim.o.clipboard        = "unnamedplus"
-- context lines 始终距离顶部或者底部3行的距离
vim.opt.so             = 3
vim.opt.smartcase      = true
vim.opt.ignorecase     = true
vim.opt.ruler          = true
vim.opt.title          = true
vim.opt.pastetoggle    = '<F9>'
vim.opt.cursorline     = true -- cursorcolumn
vim.opt.wrap           = true -- auto break line,[nowrap for the other side]
vim.opt.laststatus     = 2    -- Always show the status line
vim.opt.encoding       = 'utf8'
-- vim.opt.termencoding='utf8'
vim.opt.showtabline    = 0 -- Always display the tabline, even if there is only one tab"
-- Hide the default mode text (e.g. -- INSERT -- below the statusline)"
-- vim.opt. noshowmode
-- vim.opt.backspace=2 -- 支持delete键
vim.opt.ffs            = 'unix' -- Default to Unix LF line endings"
vim.opt.ambiwidth      = 'single'

-- vim.opt. colorcolumn=85                     " visual indicator at column 120
vim.opt.linespace      = 5 -- give the code some breathing room
vim.opt.list           = true
--vim.opt.listchars = {tab = '  ', trail = '∙'}
--vim.opt.fillchars = {vert = ' ', eob = ' ', msgsep = '‾'}
--vim.opt.redrawtime = 10000 -- syntax enable for big file

-- TextEdit might fail if hidden is not set.
vim.opt.hidden         = true

-- Some servers have issues with backup files, see #649.
-- set nobackup
-- set nowritebackup

-- Give more space for displaying messages.
-- set cmdheight=2

-- Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
-- delays and poor user experience.
vim.opt.updatetime     = 100

-- Don't pass messages to |ins-completion-menu|.
vim.opt.shortmess      = vim.opt.shortmess + 'c'

-- Always show the signcolumn, otherwise it would shift the text each time
-- diagnostics appear/become resolved.
vim.opt.signcolumn     = 'yes'

if vim.g.vscode then
    -- VSCode extension
else
    -- ordinary Neovim
end
